<!DOCTYPE html>












  


<html class="theme-next pisces use-motion" lang="zh-CN">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"/>
<meta name="theme-color" content="#222">






  
  
    
      
    
    
      
    
  <script src="https://cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
  <link href="https://cdn.bootcss.com/pace/1.0.2/themes/blue/pace-theme-flash.min.css" rel="stylesheet">







<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />






















  

<link href="https://cdn.bootcss.com/font-awesome/4.6.2/css/font-awesome.min.css" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=6.3.0" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=6.3.0">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=6.3.0">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=6.3.0">


  <link rel="mask-icon" href="/images/logo.svg?v=6.3.0" color="#222">









<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '6.3.0',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: false,
    fastclick: false,
    lazyload: false,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>


  




  <meta name="description" content="vim记录vim 是个非常不错的编辑器。如果诸君有尝试过去记住编辑器的快捷键从而达到尽量减少鼠标或是触摸板的使用的话，那么 vim 一定会让你感到自在。当然，在最开始的时候，虽然我是键盘流工作的爱好者，但是也对 vim 充满了畏惧，真正接触下来的时候，会感到 vim 还是很有意思的。所以目前我也是在不断熟悉 vim 的时候，考虑到网上 vim 的文章相当多，这里权当是在记录学习过程中，我觉得有用到">
<meta name="keywords" content="vim">
<meta property="og:type" content="article">
<meta property="og:title" content="vim记录">
<meta property="og:url" content="http://yoursite.com/2018/12/09/vim记录/index.html">
<meta property="og:site_name" content="三月的米店">
<meta property="og:description" content="vim记录vim 是个非常不错的编辑器。如果诸君有尝试过去记住编辑器的快捷键从而达到尽量减少鼠标或是触摸板的使用的话，那么 vim 一定会让你感到自在。当然，在最开始的时候，虽然我是键盘流工作的爱好者，但是也对 vim 充满了畏惧，真正接触下来的时候，会感到 vim 还是很有意思的。所以目前我也是在不断熟悉 vim 的时候，考虑到网上 vim 的文章相当多，这里权当是在记录学习过程中，我觉得有用到">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http://yoursite.com/2018/12/09/vim记录/2059132621.jpg">
<meta property="og:updated_time" content="2018-12-09T12:58:42.695Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="vim记录">
<meta name="twitter:description" content="vim记录vim 是个非常不错的编辑器。如果诸君有尝试过去记住编辑器的快捷键从而达到尽量减少鼠标或是触摸板的使用的话，那么 vim 一定会让你感到自在。当然，在最开始的时候，虽然我是键盘流工作的爱好者，但是也对 vim 充满了畏惧，真正接触下来的时候，会感到 vim 还是很有意思的。所以目前我也是在不断熟悉 vim 的时候，考虑到网上 vim 的文章相当多，这里权当是在记录学习过程中，我觉得有用到">
<meta name="twitter:image" content="http://yoursite.com/2018/12/09/vim记录/2059132621.jpg">






  <link rel="canonical" href="http://yoursite.com/2018/12/09/vim记录/"/>



<script type="text/javascript" id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  <title>vim记录 | 三月的米店</title>
  









  <noscript>
  <style type="text/css">
    .use-motion .motion-element,
    .use-motion .brand,
    .use-motion .menu-item,
    .sidebar-inner,
    .use-motion .post-block,
    .use-motion .pagination,
    .use-motion .comments,
    .use-motion .post-header,
    .use-motion .post-body,
    .use-motion .collection-title { opacity: initial; }

    .use-motion .logo,
    .use-motion .site-title,
    .use-motion .site-subtitle {
      opacity: initial;
      top: initial;
    }

    .use-motion {
      .logo-line-before i { left: initial; }
      .logo-line-after i { right: initial; }
    }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">三月的米店</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
      
        <h1 class="site-subtitle" itemprop="description">今儿不吃饭</h1>
      
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">
    <a href="/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-home"></i> <br />首页</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">
    <a href="/tags/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />标签</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-categories">
    <a href="/categories/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-th"></i> <br />分类</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">
    <a href="/archives/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />归档</a>
  </li>

      
      
    </ul>
  

  

  
</nav>



  



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
            

          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/12/09/vim记录/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Mark Lee">
      <meta itemprop="description" content="折腾小久的博客,在 2018-08-01 终于基本成型啦，以后就常驻啦">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="三月的米店">
    </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">vim记录
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">

            
            
            

            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2018-12-09 19:13:19 / 修改时间：20:58:42" itemprop="dateCreated datePublished" datetime="2018-12-09T19:13:19+08:00">2018-12-09</time>
            

            
              

              
            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/工具/" itemprop="url" rel="index"><span itemprop="name">工具</span></a></span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="vim记录"><a href="#vim记录" class="headerlink" title="vim记录"></a>vim记录</h1><p><code>vim</code> 是个非常不错的编辑器。如果诸君有尝试过去记住编辑器的快捷键从而达到尽量减少鼠标或是触摸板的使用的话，那么 <code>vim</code> 一定会让你感到自在。<br>当然，在最开始的时候，虽然我是键盘流工作的爱好者，但是也对 <code>vim</code> 充满了畏惧，真正接触下来的时候，会感到 <code>vim</code> 还是很有意思的。所以目前我也是在不断熟悉 <code>vim</code> 的时候，考虑到网上 <code>vim</code> 的文章相当多，这里权当是在记录学习过程中，我觉得有用到的快捷键再这里补充记录，毕竟 <code>vim</code> 的快捷键确实还有点多的。<br>顺带提一句，我是在我的 <code>webstorm</code> 和 <code>vscode</code> 中安装了 <code>vim</code> 插件，这样在已经习惯好的编辑器慢慢熟悉 <code>vim</code> ,同时也能在 <code>vim</code> 不好搞的时候，切回到之前的工作流程。<code>jetbrain</code>系玩家，除了安装 <code>ideaVim</code> 还应该去安装 <code>ideaVimExtension</code>，这个插件主要是解决插入模式和普通模式切换的时候需要来回切换的问题。很遗憾，我在 <code>vscode</code> 貌似没有找到这个插件。<br>另外，推荐诸君使用 <code>chrome</code> 的插件 <code>vimium</code>，我认为诸君即使对 <code>vim</code> 不感兴趣也应该安装这个插件，我只能说实在是太好用了。</p>
<p>由于我也是 <code>vim</code> 新学者，内容都是按照我的理解去写，不能保证概念上的正确，概念上也不会说的详细。我也是只记录我觉得常用，有用的快捷键。</p>
<p>另外 <code>mac</code> 用户，建议把键盘设置里的重复按键的延迟拉到最快，这样光标移动起来会快很多。</p>
<h2 id="模式"><a href="#模式" class="headerlink" title="模式"></a>模式</h2><ol>
<li>普通模式</li>
<li>插入模式</li>
<li>命令行模式</li>
<li>视图模式</li>
</ol>
<p>一般情况下都是在普通模式的时候，在需要的时候才会切换模式。插入模式、视图模式的时候 <code>Esc</code> 键就能回到普通模式。</p>
<h2 id="移动"><a href="#移动" class="headerlink" title="移动"></a>移动</h2><ul>
<li><code>j</code>，<code>k</code>，<code>h</code>，<code>l</code>分别对应 <em>下</em> 、<em>上</em>、<em>左</em>、<em>右</em>。</li>
<li><code>gg</code> 回到第一行，<code>G</code>到最后一行。</li>
<li><code>w</code> 跳下个单词词首，<code>e</code>跳下个单词词尾，<code>b</code>反向跳词首，其中<code>W</code>、<code>E</code>、<code>B</code>功能和小写的功能差不多，能直接跳过一些符号。</li>
<li><code>:31</code> 进入命令行模式，直接跳到31行。</li>
<li><code>12G</code> 跳到12行。</li>
<li><code>H</code>、<code>L</code>、<code>M</code>跳到当前视图的顶部，底部，中间。顺带一提 <code>zz</code> 能够让光标所在行定位到屏幕的中间。</li>
<li><code>$</code>、<code>^</code>、0，$ 是回到行尾，^、0类似，回到行首，0是第一格，^ 是行首。</li>
</ul>
<h2 id="进入插入模式"><a href="#进入插入模式" class="headerlink" title="进入插入模式"></a>进入插入模式</h2><ul>
<li><code>i</code>、<code>a</code>，插入和追加，细微差别。</li>
<li><code>I</code>、<code>A</code>， 行首插入和行尾插入。</li>
<li><code>o</code>、<code>O</code>，当前行的下一行插入和上一行插入，<code>o</code>和 <code>webstorm</code> 的<code>shift + enter</code>效果一样。</li>
<li><code>caw</code>、<code>cw</code> 删除光标所在单词，并进去插入模式，这个键太好用了。<code>cw</code>不会删除光标所在单词的前面部分。</li>
<li><code>ci&quot;</code>、<code>ci&#39;</code>、<code>cit</code> 删除双引号、单引号、<code>xml</code>标签包裹的内容，并进入插入模式。</li>
<li><code>ca&quot;</code>、<code>ca&#39;</code>、<code>cat</code> 和上面类似，不同的是多删除掉了双引号、单引号、<code>xml</code> 标签。</li>
</ul>
<h2 id="操作"><a href="#操作" class="headerlink" title="操作"></a>操作</h2><ul>
<li><code>x</code> 删除。</li>
<li><code>daw</code> 删除一个单词。</li>
<li><code>d$</code>、<code>d^</code> 删除到行为、行首。</li>
</ul>
<h2 id="杂"><a href="#杂" class="headerlink" title="杂"></a>杂</h2><ul>
<li><code>u</code> 撤销。</li>
<li><code>ctrl + r</code> 重做。</li>
<li><code>zc</code>、<code>zo</code> 折叠代码，展开代码。</li>
<li><code>&lt;</code>、<code>&gt;</code> 缩进。</li>
</ul>
<hr>
<p><img src="/2018/12/09/vim记录/2059132621.jpg" alt="Thatched Cottages in the Sunshine "></p>
<blockquote>
<p>Vincent van Gogh – Thatched Cottages in the Sunshine 1890</p>
</blockquote>

      
    </div>

    

    
    
    

    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/vim/" rel="tag"><i class="fa fa-tag"></i> vim</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/12/02/阴天/" rel="next" title="阴天">
                <i class="fa fa-chevron-left"></i> 阴天
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/12/31/结束与开始/" rel="prev" title="结束与开始">
                结束与开始 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>


  </div>


          </div>
          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">Mark Lee</p>
              <p class="site-description motion-element" itemprop="description">折腾小久的博客,在 2018-08-01 终于基本成型啦，以后就常驻啦</p>
          </div>

          
            <nav class="site-state motion-element">
              
                <div class="site-state-item site-state-posts">
                
                  <a href="/archives/">
                
                    <span class="site-state-item-count">26</span>
                    <span class="site-state-item-name">日志</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-categories">
                  <a href="/categories/index.html">
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">4</span>
                    <span class="site-state-item-name">分类</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-tags">
                  <a href="/tags/index.html">
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">20</span>
                    <span class="site-state-item-name">标签</span>
                  </a>
                </div>
              
            </nav>
          

          

          

          
          

          
          

          
            
          
          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#vim记录"><span class="nav-number">1.</span> <span class="nav-text">vim记录</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#模式"><span class="nav-number">1.1.</span> <span class="nav-text">模式</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#移动"><span class="nav-number">1.2.</span> <span class="nav-text">移动</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#进入插入模式"><span class="nav-number">1.3.</span> <span class="nav-text">进入插入模式</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#操作"><span class="nav-number">1.4.</span> <span class="nav-text">操作</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#杂"><span class="nav-number">1.5.</span> <span class="nav-text">杂</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2018</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Mark Lee</span>

  

  
</div>


  


<!--

  <div class="powered-by">由 <a class="theme-link" target="_blank" rel="external nofollow" href="https://hexo.io">Hexo</a> 强力驱动 v3.7.1</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" rel="external nofollow" href="https://theme-next.org">NexT.Pisces</a> v6.3.0</div>

-->



        








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    
	
    

    
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>


























  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=6.3.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=6.3.0"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=6.3.0"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=6.3.0"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=6.3.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=6.3.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=6.3.0"></script>



  



  










  





  

  

  

  

  
  

  

  

  

  

  

</body>
</html>
